﻿using NHibernate.Mapping.ByCode;
using NHibernate.Mapping.ByCode.Conformist;
using WorkLogger.Client.DataAccess.Model;

namespace WorkLogger.Client.DataAccess.Mappings {
	public class LunchTimeMap : ClassMapping<LunchTime> {
		public LunchTimeMap() {
			Id(lunchTime => lunchTime.LunchTimeId, m => m.Generator(Generators.Identity));

			Property(lunchTime => lunchTime.StartLunch, mapper => mapper.NotNullable(true));
			Property(lunchTime => lunchTime.EndLunch, mapper => mapper.NotNullable(true));
			ManyToOne(lunchTime => lunchTime.WorkDay, map => map.Column("WorkDayId"));
		}
	}
}